import request from '@/utils/request'

// 查询头表列表

export function listOQC(query) {
  return request({
    url: '/mes/qc/oqc/list',
    method: 'get',
    params: query
  })
}
// 查询OQC检验列表
// export function listInspection(query) {
//   return request({
//     url: '/mes/qc/qcOqcInspection/list',
//     method: 'get',
//     params: query
//   })
// }
// 查询OQC检验列表
export function listInspection(query) {
  return request({
    url: '/mes/qc/qcOqcInspection/qcOqcInspectionList',
    method: 'get',
    params: query
  })
}
// 查询OQC检验列表
export function qcOqcInspectionNewList(query) {
  return request({
    url: '/mes/qc/qcOqcInspection/qcOqcInspectionNewList',
    method: 'get',
    params: query
  })
}

// 查询OQC检验详细
export function getInspection(oqcId) {
  return request({
    url: '/mes/qc/qcOqcInspection/' + oqcId,
    method: 'get'
  })
}
// 查询OQC检验详细  更详细
export function templateindexList(data) {
  return request({
    url: '/mes/qc/qcOqcInspection/OqcInfo/',
    method: 'post',
    data: data
  })
}

// 新增OQC检验
export function addInspection(data) {
  return request({
    url: '/mes/qc/qcOqcInspection/addOqcInfo',
    method: 'post',
    data: data
  })
}

// 修改OQC检验
export function updateQcOqcInspection(data) {
  return request({
    url: '/mes/qc/qcOqcInspection',
    method: 'put',
    data: data
  })
}

// 删除OQC检验
export function delQcOqcInspection(oqcId) {
  return request({
    url: '/mes/qc/qcOqcInspection/' + oqcId,
    method: 'delete'
  })
}

//异常记录需要用到的检查项
export function getabnormalList(query) {
  return request({
    url: '/mes/ipqc/base/inspection/indexType/listByTemplateId',
    method: 'get',
    params: query
  })
}

//详情接口
// export function getDetail(data) {
//   return request({
//     url: '/mes/qc/qcOqcInspection/checkInspect',
//     method: 'post',
//     data: data
//   })
// }
export function getDetail(id) {
  return request({
    url: '/mes/qc/oqcRecords/getOqcInspectionInfo/' + id,
    method: 'get'
  })
}

//验证SN码是否正确
export function OqccheckSncode(query) {
  return request({
    url: '/mes/qc/qcOqcInspection/foolProofing',
    method: 'get',
    params: query
  })
}


// 获取Sn
export function getOqcSnCode(query) {
  return request({
    url: '/mes/serial/getSnList',
    method: 'get',
    params: query
  })
}
// 详情列表
export function getOqcRecordInfo(headId) {
  return request({
    url: '/mes/qc/oqcRecords/getOqcRecordInfo/' + headId,
    method: 'get'
  })
}

export function handleExport(data) {
  return request({
    url: 'mes/qc/qcOqcInspection/export',
    method: 'post',
    data: data
  })
}
